package com.promfy.userinterface.animation.gif;

import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.promfy.R;

public class GifAnimationActivity extends Activity implements OnClickListener {
	/** Called when the activity is first created. */
	private ImageView imageView;
	private AnimationDrawable animationDrawable;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.imageview);
			
		imageView = (ImageView) findViewById(R.id.imageview);
		imageView.setBackgroundResource(R.anim.frame_animation); 

		animationDrawable = (AnimationDrawable) imageView.getBackground(); 
		
		imageView.setOnClickListener(this);
	}
	
	public void onClick(View button) {
		// TODO Auto-generated method stub
		switch (button.getId()) {
		case R.id.imageview: 
			animationDrawable.start();
			break;

		default:
			break;
		}
	}
}